function [rawimages,img_time,type_img,expp,pxsize] = ReadImage(hdfFilePath)

    % Reads raw images and imaging parameters from hdf5 file.
    % 
    % Input: hdf5 file path
    % Output: 
    %       - rawimages: array cell containg either 1 (fluor.) or 3 (abs.)
    %       images. Type is double.
    %       - img_time: exposure time of camera. 
    %       - type_img: 1 for fluorescence, 3 for absorption
    %       - expp: structure containing imaging system parameters (see ParamImgSys.m)
    %       - pxsize: pixel size based on imaging system parameter
    % 19 February 2014

    if ~ischar(hdfFilePath)
        error('Path must be a string');
    end

    rawimages = cast(h5read(hdfFilePath,'/Image/image'),'double')/4; % Divide by 4 as 14-bit data from camera is multiplied by 4 (presumably when cast as a 16-bit integer).
    img_time = h5read(hdfFilePath,'/Image/exposuretime');
    type_img = h5read(hdfFilePath,'/Image/typeimaging');
    
    expp = ReadImgConfig(hdfFilePath);
    pxsize = expp.px_size/expp.mag;
end
